<?php

if (!init()) {
  redirect('?action=login');
}

$resultSet = deleteSubscription($_GET['tid']);
$initiatorAction = \controller\ControllerUtil::getEncodedActionFromUrlWithParameters($_SERVER['HTTP_REFERER']);


if ($resultSet) {
  redirect("?action=msg&header=header.subscr.del.success&body=body.subscr.del.success&view=" . $initiatorAction);
} else {
  redirect("?action=msg&header=header.subscr.del.failed&body=body.subscr.del.failed&view=" . $initiatorAction);
}